package com.leo.web.base;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by luyijuan on 2016/3/19.
 */
@Controller
@RequestMapping("/")
public class IndexCtrl {
    @RequestMapping("run")
    public String run(Model modes,HttpServletRequest request,HttpServletResponse response){
        return "/index";
    }

    @RequestMapping("test")
    @ResponseBody
    public JSONObject test(){
        JSONObject json = new JSONObject();
        json.put("success",true);
        json.put("msg","我成功了吗?");
        return json;
    }
}
